import { Component, OnInit } from '@angular/core';

declare var  $;

@Component({
  selector: 'app-down-load-app-lead',
  templateUrl: './down-load-app-lead.component.html',
  styleUrls: ['./down-load-app-lead.component.css']
})
export class DownLoadAppLeadComponent implements OnInit {
  ua;
  constructor() { }

  ngOnInit() {
    this.initStyle();
    this.weixinShow();
  }

  openUrl() {
    window.open("http://env.scsoft.com.cn:8023/damUpdate/AirMonitor.apk");
  }
  initStyle(){
    $(".weixin-tip").height($(window).height());
    $(".weixin-tip").width($(window).width());
  }

  weixinShow(){
    let isWeixin = this.is_weixin();
    if (isWeixin) {
      $(".weixin-tip").show();
    }
  }
  is_weixin() {
    this.ua = navigator.userAgent.toLowerCase();
    if (this.ua.match(/MicroMessenger/i) == "micromessenger") {
      return true;
    } else {
      return false;
    }
  }

}
